﻿@using Abp.Authorization.Users
@model WanFang.Web.Models.Account.RegisterViewModel
@{ 
    Layout = "~/Views/Shared/_TestLayout.cshtml";
}

@section headSec
{
    <script>
        $(document).ready(function () {
            $("form").submit(function () {
                $(this).ajaxSubmit({
                    type: 'post',
                    url: '/TestUsers/Update',
                    dataType: 'json',
                    success: function (data) {
                        console.log(data);
                        console.log(data.errcode);
                        if (data.result.errcode == 0) {
                            alert("添加成功");
                            location.reload();
                        } else {
                            alert("添加失败");
                        }
                    }
                })
                return false;
            });
        })
    </script>
}
<div class="card">
    <div class="body">
        <form id="RegisterForm" asp-action="Register" method="POST">
            <h4 class="text-center">注册</h4>
            
            @Html.AntiForgeryToken()
            

            <input type="hidden" name="IsExternalLogin" value="@Model.IsExternalLogin.ToString()" />
            <input type="hidden" name="ExternalLoginAuthSchema" value="@Model.ExternalLoginAuthSchema" />

            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="Name" value="@Model.Name" required maxlength="@AbpUserBase.MaxNameLength">
                    <label class="form-label">@L("Name")</label>
                </div>
            </div>

            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="Surname" value="@Model.Surname" required maxlength="@AbpUserBase.MaxSurnameLength">
                    <label class="form-label">@L("Surname")</label>
                </div>
            </div>

            <div class="form-group form-float">
                <div class="form-line">
                    <input type="email" class="form-control" name="EmailAddress" value="@Model.EmailAddress" required maxlength="@AbpUserBase.MaxEmailAddressLength">
                    <label class="form-label">@L("EmailAddress")</label>
                </div>
            </div>

            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="UserName" value="@Model.UserName" required maxlength="@AbpUserBase.MaxUserNameLength">
                    <label class="form-label">@L("UserName")</label>
                </div>
            </div>

            <div class="form-group form-float">
                <div class="form-line">
                    <input type="password" class="form-control" name="Password" required maxlength="@AbpUserBase.MaxPlainPasswordLength">
                    <label class="form-label">@L("Password")</label>
                </div>
            </div>

            <div class="row">
                <div class="col-xs-12">
                    <button id="RegisterButton" class="btn bg-pink waves-effect" type="submit">update</button>
                </div>
            </div>
        </form>
    </div>
</div>